package com.zmn.oms.dubbo.impl.zmn.callrecord;

import com.zmn.common.dto2.ResponseDTO;
import com.zmn.oms.dubbo.interfaces.zmn.callrecord.OrderCallRecordListRemoteService;
import com.zmn.oms.dubbo.utils.DubboConsts;
import com.zmn.oms.services.interfaces.callrecord.OrderCallRecordService;
import org.apache.dubbo.config.annotation.Service;

import java.util.Date;

/**
 * 订单通话记录查询远程服务实现
 *
 * @author hankangshuai
 * @since 2020/12/22
 */
@Service(loadbalance = "roundrobin", timeout = 20000, retries = 2, version = DubboConsts.INTERFACE_VERSION, validation = "true")
public class OrderCallRecordListRemoteServiceImpl implements OrderCallRecordListRemoteService {
    private final OrderCallRecordService orderCallRecordService;

    public OrderCallRecordListRemoteServiceImpl(OrderCallRecordService orderCallRecordService) {
        this.orderCallRecordService = orderCallRecordService;
    }

    @Override
    public ResponseDTO<Date> getFirstStartTime(Long orderId) {
        Date firstStartTime = orderCallRecordService.findFirstStartTime(orderId);
        return ResponseDTO.success(firstStartTime);
    }

}
